﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using 基于WPF的电缆采样数据分析系统.Models.Task;
using 基于WPF的电缆采样数据分析系统.ViewModels.TDRWork;

namespace 基于WPF的电缆采样数据分析系统.Views.TDRWork
{
    /// <summary>
    /// ImportAndExportUC.xaml 的交互逻辑
    /// </summary>
    public partial class ImportAndExportUC : UserControl
    {
        List<TaskDataInfo> taskDataInfos = new List<TaskDataInfo>();

        public ImportAndExportUC()
        {
            InitializeComponent();

            this.DataContext = ImportAndExportUCViewModel.Instance;
        }

        /// <summary>
        /// 全选按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void HeaderCheckBox_Checked(object sender, RoutedEventArgs e)
        {
            for (int i = 0; i < ImportAndExportUCViewModel.Instance.CurrentTaskList.Count; i++)
            {
                ImportAndExportUCViewModel.Instance.CurrentTaskList[i].IsSelected = true;
            }
        }

        /// <summary>
        /// 全不选按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void HeaderCheckBox_Unchecked(object sender, RoutedEventArgs e)
        {
            for (int i = 0; i < ImportAndExportUCViewModel.Instance.CurrentTaskList.Count; i++)
            {
                ImportAndExportUCViewModel.Instance.CurrentTaskList[i].IsSelected = false;
            }
        }

    }
}
